/*
 * 企业QQ在线咨询
 * 单个
 *$.BizQQ({aty: '0', a: '0', nameAccount: 4008333870, selector: 'id'});
 * 多个
 *$.BizQQ([{aty: '0', a: '0', nameAccount: 4008333870, selector: 'id'}]);
 *
 * */
;
(function (factory) {
    if (typeof define === 'function') {
        define(function (require, exports, moudles) {
            return factory(require('jquery'));
        });
    } else {
        factory(jQuery);
    }
}(function ($) {
    var defaults = {
        aty: '0',
        a: '0',
        nameAccount: '4008333870'
    };
    var url = 'http://wpa.b.qq.com/cgi/wpa.php';
    return $.BizQQ = function (options) {
        if ($.isArray(options)) {
            $.BizQQ.options = $.each(options, function (index, item) {
                options[index] = $.extend({}, defaults, item)
            })
        } else if ($.type(options) == 'object') {
            $.BizQQ.options = $.extend({}, defaults, options);
        } else {
            $.BizQQ.options = defaults
        }
        $(function () {
            $.getScript(url, function () {
                BizQQWPA.addCustom($.BizQQ.options);
            });
        })
    };
}));